package cn.gson.crm.controller.counselor;

import java.util.List;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.gson.crm.controller.BaseServlet;
import cn.gson.crm.model.dao.Jdbc;
import cn.gson.crm.model.dao.StudentPoDao;
import cn.gson.crm.model.entity.Attachs;

/**
 * 显示上传的附件
 */
@WebServlet("/view-attach")
public class ViewAttach extends BaseServlet {
	private static final long serialVersionUID = 1L;
	private StudentPoDao stuPoDao = new StudentPoDao();
       
	@Override
	protected void get(HttpServletRequest request, HttpServletResponse response) throws Exception {
		super.get(request, response);
		String record = request.getParameter("record");
		String model = request.getParameter("model");
		System.out.println(model);
		
		List<Attachs> attList = stuPoDao.showAllAttach(Integer.parseInt(record), model);
		
		request.setAttribute("attList", attList);
		forward("counselor/view-attach.jsp");
	}
}
